<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt' %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<html>
<head>

<title>产品列表</title>
</head>
<c:if test="${empty param.categorycount}">
	<c:set var = "categorycount" scope="page" value="100" />
</c:if>

<c:if test="${!empty param.categorycount}">
	<c:set var = "categorycount" scope="page" value="${param.categorycount}" />
</c:if>


<div class="categoryPageDiv">
	<div class="categoryProducts">
		<c:forEach items="${category.products}" var="p" varStatus="stc" >
			<c:if test="${stc.count<=categorycount}">
				<div price="${p.promotePrice}" class="productUnit">
					<div class="productUnitFrame">
						<a href="foreproduct?product.id=${p.id}">
							<img src="./img/productSingle_middle/${p.firstProductImage.id}.jpg" class="productImage" />
						</a>
						<span class="productPrice">¥<fmt:formatNumber type="number" value="${p.promotePrice}" minFractionDigits="2" /></span>
						<a href="foreproduct?product.id=${p.id}" class="productLink">
							${fn:substring(p.name,0,50)}
						</a>
						<a href="foreproduct?product.id=${p.id}" class="tmallLink">天猫专卖</a>
						<div class="productInfo">
							<span class="monthDeal">月成交 <span class="productDealNumber">${p.saleCount}笔</span></span>
							<span class="productReview">评价<span class="productReviewNumber">${p.reviewCount}</span></span>
							<span class="wangwang">
		                    <a href="#nowhere" class="wangwanglink">
		                        <img src="./img/site/wangwang.png">
		                    </a>
		                    </span>
						</div>
					</div>
				</div>
			</c:if>
		</c:forEach>
		<div style="clear:both"></div>
	</div>
</div>
</html>